<?php
declare(strict_types=1);

namespace App\Dao;

use App\Model\RoleAdmin;

class RoleAdminDao
{

    public function add($data)
    {
        return RoleAdmin::create($data);
    }

    public function update($where,$data)
    {
        return RoleAdmin::query()->where($where)->update($data);
    }

    public function delete($where)
    {
        return RoleAdmin::query()->whereIn('admin_id', $where)->delete();
    }

    //通过条件统计数量用户
    public function countByWhere($where = []){
        return RoleAdmin::query()->where($where)->count();
        
    }

    
}
